<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.CreateContentTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form enctype="multipart/form-data">

                <p:fileUpload  fileUploadListener="#{fileUploadBean.handleFileUploadModified}"
                              mode="advanced" 
                              update="messages"
                              sizeLimit="157286400" 
                              invalidSizeMessage="The maximum file size allowed is 150 Megabyte !"
                              allowTypes="/(\.|\/)(pdf|avi|txt|mp4|mov|mp3|wmv|png|jpe?g)$/"
                              />

                <p:growl id="messages" showDetail="true"/>

            </h:form>
            <h:form>
                <h:panelGrid columns="2">
                    <p:outputLabel value="#{bundle.CreateContentLabel_contentName}" for="contentName" />
                    <p:inputText id="contentName" value="#{treeBeanModified.selectedNode.entity.contentName}" title="#{bundle.CreateContentTitle_contentName}" />
                    <p:outputLabel value="#{bundle.CreateContentLabel_idForm}" for="idForm" />
                    <p:selectOneMenu id="idForm" value="#{treeBeanModified.selectedNode.entity.idForm}" required="true" requiredMessage="#{bundle.CreateContentRequiredMessage_idForm}">
                        <f:selectItems value="#{formController.itemsAvailableSelectOne}"/>
                    </p:selectOneMenu>
                 
                </h:panelGrid>
                <br />
                <h:commandLink action="#{treeBeanModified.createcontent()}" value="#{bundle.CreateContentSaveLink}" />
     
            </h:form>
        </ui:define>
    </ui:composition>

</html>
